package com.xjd.edu.admin.controller.demo;

import com.xjd.edu.course.service.book.BookInfoService;
import com.xjd.edu.user.client.UserInfoClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/admin")
public class DemoController {

    @Autowired
    private BookInfoService bookInfoService;

    @Autowired
    private UserInfoClient userInfoClient;

    /**
     * 测试
     *
     * @return
     */
    @RequestMapping("/demo")
    public Object demo() {
        Map<String, Object> map = new HashMap<>();
        map.put("feign bookInfoService.getBookInfo", bookInfoService.getBookInfo());
        map.put("feign bookInfoService.getBookInfoList", bookInfoService.getBookInfoList());
        map.put("feign userInfoClient.getUserInfo", userInfoClient.getUserInfo());
        return map;
    }
}
